/**
 * There are <a href="https://www.hdzhx.com">邯郸智讯</a> code generation
 */
package com.boxin.ims.modules.wechat.entity.tmessage;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.BaseEntity;
import com.thinkgem.jeesite.modules.sys.entity.User;

/**
 * 系统消息模板Entity
 * @author 肖乾
 * @version 2014-09-11
 */
@Entity
@Table(name = "wp_business_message_template")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class BusinessMessageTemplate extends BaseEntity {
	
	public final static String CODE_SIGNUP = "signup";//签到
	public final static String SCORE_EXCHANGE  = "scoreExchange";//积分兑换
	public final static String TO_BE_MEMBER  = "toBeMember";//成为会员
	public final static String SECONDS_KILL = "secondsKill";//秒杀
	public final static String RED_PACKET = "redPacket";//获奖提醒
	public final static String BUY_SUCCESS = "buySuccess";//购买成功通知
	public final static String SHENHE = "shenheSuccess";//审核成功通知
	public final static String WANCHENG = "wanCheng";//服务完成通知
	public final static String PAIDAN = "paiDan";//派单通知
	public final static String HOUDONG = "houDong";//活动参与成功通知
	
	////////////////////////////////////////////////////
	public final static String POINTTONGZHI="pointTongZhi";//积分通知
	public final static String SETTLEMENT ="settlement";//	结算通知
	public final static String ORDERCREATE="orderCreate";//	订单创建成功通知
	public final static String ORDERCONFIRM="orderConfirm";//订单确认通知
	public final static String POINTARRIVAL = "pointArrival";//积分到账通知
	public final static String ORDERCOMPLETE="orderComplete";//订单完成通知
	public final static String ORDERCANCEL="orderCancel";//订单取消通知
	
	
	public final static String ADD_MONEY = "addMoney";
	
	
	public final static String MEMBER_SCORE_CHANGE = "memberScoreChange";//会员积分变动提醒
	public final static String BUY_TIXING = "buyTixing";//购买提醒  
		
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private User user; 		// 用户
	private String name; 	// 标题
	private String title; 	// 模板标题
	private String code; 	// 标识
	private String content; 	// 详细内容
	private String sample;// 样例
	
	
	private Date createTime;	// 创建日期

	public BusinessMessageTemplate() {
		this.createTime = new Date();
	}

	public BusinessMessageTemplate(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_wechat_tmessage_businessMessageTemplate")
	//@SequenceGenerator(name = "seq_wechat_tmessage_businessMessageTemplate", sequenceName = "seq_wechat_tmessage_businessMessageTemplate")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne
	@JoinColumn(name="user_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Length(min=1, max=200)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	
	@NotNull
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSample() {
		return sample;
	}

	public void setSample(String sample) {
		this.sample = sample;
	}
	
	
}


